import axios from 'axios'

export default class  {
   
    //添加进度款申请信息
    Addapply(apply,projectId,providerId,ctr_id,realName){
        return axios.get(`http://localhost/smj_apply`,{
            params:{
                'apply_date':apply.apply_date,
                'p_id':projectId ,
                'ctr_id':ctr_id,
                'company_id':providerId,
                'payment_name':apply.payment_name,
                'contract_amount':apply.contract_amount,
                'penalty':apply.penalty,
                'withhold':apply.withhold,
                'settle_type':apply.settle_type,
                'agree_amount':apply.agree_amount,
                'agree_upper':apply.agree_upper,
                'handler_id':apply.handler_id,
                'update_user':realName,
                'settle_comment':apply.settle_comment,
                'attach_ids':apply.attach_ids,
            }
        })
    }

    //添加进度宽申请工程量清单
    AddWorkList(tenderPurchaseDetails,id){
        return axios.get(`http://localhost/smj_apply/work_list`,{
            params:{
                'apply_id':id,
                'work_content':tenderPurchaseDetails.work_content ,
                'work_count':tenderPurchaseDetails.work_count,
                'unit':tenderPurchaseDetails.unit,
                'unit_price':tenderPurchaseDetails.unit_price,
                'snumber':tenderPurchaseDetails.snumber,
                'hnumber':tenderPurchaseDetails.hnumber,
                'comment':tenderPurchaseDetails.comment,
            }
        })
    }

    //提交审批
    FlowApply(Apply){
        return axios.post(`http://localhost/smj_apply/Flow_apply`,Apply)
    }

    //查询进度款申报列表
    listApply(params){
        return axios.get(`http://localhost/smj_apply/listApply`,{
            params:params
        })
    }

    //查询进度审批工程量
    getWorkList(id){
        return axios.get(`http://localhost/smj_apply/getWorkList`,{
            params:{
                'id':id
            }
        })
    }

    //流程审批查询
    getfromaudit(id){
        return axios.get(`http://localhost/smj_apply/getfromaudit`,{
            params:{
                'id':id
            }
        })
    }

}